package com.sumainfor.pc.gmio.service.impl;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.dao.ComplaintTypeMapper;
import com.sumainfor.pc.gmio.service.ComplaintTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ComplaintTypeServiceImpl implements ComplaintTypeService {

    @Autowired
    ComplaintTypeMapper complaintTypeMapper;

    @Override
    public JsonResult getComplaintType() {
        JsonResult result = new JsonResult();
        List<Map<String, Object>> typelist = complaintTypeMapper.getComplaintType();//先查询出投诉类型
        for (Map<String, Object> map : typelist) {
            map.put("info", complaintTypeMapper.getComplaintcontent(map.get("ComptId").toString()));//查询出详表的
        }
        result.put(typelist);
        return result;
    }
}
